<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <!-- Custom Fonts -->

    <title>NLP 基础服务 </title>

    <!-- Bootstrap Core CSS -->
    <!--<link href="static/css/bootstrap.min.css" rel="stylesheet">-->

    <!-- MetisMenu CSS -->
    <!--<link href="static/css/plugins/metisMenu/metisMenu.min.css" rel="stylesheet">-->

    <!-- Timeline CSS -->
    <!--<link href="static/css/plugins/timeline.css" rel="stylesheet">-->
    <link href="static/css/n_demo.css" rel="stylesheet">

    <!-- Custom CSS -->
    <!--<link href="static/css/sb-admin-2.css" rel="stylesheet">-->

    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
          integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">


</head>

<body>

<div id="container">
    <!-- Navigation -->
    <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
        </div>
    </nav>

    <div id="demo-page">
        <div id="demo-container" class="container">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header text-center">NLP 基础服务</h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>

            <div class="row">
                <div class="col-xs-9">
                    <div class="row">
                        <div class="col-lg-12">
                            <form role="form">
                                <div class="form-group">
                                    <label>输入文本</label>
                                    <textarea class="form-control text-left" rows="5" id="input"></textarea>
                                </div>
                                <div class="pull-right">
                                    <button type="button" class="btn btn-success btn-large" id="subb">提 交
                                    </button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>


            <div class="demo-content">
                <div class="col-xs-9 main-content">
                    <div id="overview-analysis" class="chunk">
                        <div class="col-xs-12">
                            <dl id="seg_result" class="words"></dl>
                        </div>
                    </div>

                    <div id="overview-ner" class="chunk">
                        <div class="col-xs-12">
                            <dl id="ner_result" class="words">
                            </dl>
                        </div>
                    </div>
                </div>

                <!-- /.row -->
            </div>

        </div>
        <!-- /.row -->

    </div>
    <!-- /#page-wrapper -->

</div>


<script src="static/js/jquery-1.11.0.js"></script>

<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"
        integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
        crossorigin="anonymous"></script>
<!-- Bootstrap Core JavaScript -->
<!--<script src="static/js/bootstrap.min.js"></script>-->

<!-- Custom Theme JavaScript -->
<script>
    $(document).ready(function() {
        $("#subb").bind('click', function(){
        var input_text = $("#input").val();
              $.ajax({
                    type:'POST',
                    url:'/nlp',
                    dataType:'json',
                    async: true,
                    data:{'text':input_text},
                    success:function(data){
                       $("#seg_result").html(data["seg_result"]);
                       $("#ner_result").html(data["ner_result"]);
                       console.log(data["ner_result"])
                    }
              });
        });
    });
</script>

</body>

</html>